def new_num(num):
    print(sorted(num.items(),key=lambda x:x[0]))

# 求列表的所有奇数，并构造新列表
def odd_num(num1):
    num2=[i for i  in num1 if i %2==1]
    print(num2)
# 用一行代码生成[1,4,9,16,25,36,49,64,81,100]
def new_list():
    list=[i*i for i in range(1,11)]
    print(list)

# 写一个函数找出一个整数数组中，第二大的数
def second_num(num1):
    sorted_num=sorted(num1)
    print(sorted_num[-2])

def second_num2(num1):
    one = float('-inf')
    two = float('inf')
    for num in num1:
        if num >one:
            two = one
            one =num
        elif num >two and num !=one:
            two = num
        # return two
    print(two)


def sort_num():
    symbols ='+-+-+---+++'
    symbols_list=list(symbols)
    symbols_list.sort(key=lambda x:(x=='+'),reverse=True)
    sorted_symbols=''.join(symbols_list)
    print(sorted_symbols)
if __name__ == '__main__':
    num={'a':23,'d':8,'c':12}
    num1 = [9, 2, 10, 4, 5]
    # new_num(num)
    # odd_num(num1)
    # new_list()
    # second_num2(num1)
    sort_num()